/*
 * Position.cpp
 *
 *  Created on: Mar 30, 2011
 *      Author: cnwilson
 */

#include "../inc/Position.h"


	Position::Position(int _x,int _y){
		row=_x;
		column=_y;
	}

	Position::Position(const Position& other){
		row=other.row;
		column=other.column;
	}

	Position::~Position(){

	}

	Position& Position::operator=(const Position &other){
		if(this!=&other){
			row=other.row;
			column=other.column;
		}
		return *this;
	}
	const Position Position::operator+(const Position &other) {
		return Position(row+other.row, column+other.column);
	}
	Position& Position::operator+=(const Position& other){
		row+= other.row;
		column+= other.column;
		return *this;
	}
	bool Position::operator==(const Position &other){
		return (row==other.row && column==other.column);
	}
	bool Position::operator>(const int num){
		return row>num && column>num;
	}
	bool Position::operator<(const int num){
		return row<num && column<num;
	}
	bool Position::operator>=(const int num){
		return row>=num && column>=num;
	}
	bool Position::operator<=(const int num){
		return row<=num && column<=num;
	}
	int Position::getRow(){
		return row;
	}
	int Position::getColumn(){
		return column;
	}
